
package com.ossean.match.lucene;

import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
//import org.apache.lucene.analysis.Analyzer;
//import org.apache.lucene.analysis.TokenStream;
//import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.wltea.analyzer.core.IKSegmenter;
import org.wltea.analyzer.core.Lexeme;
//import org.wltea.analyzer.lucene.IKAnalyzer;

public class IKTest {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
//		InputStream in = ClassLoader.getSystemResourceAsStream("ext.dic");
//		System.out.println(in);
		Reader text = new StringReader("Google-books123 boost111 mysql++");
		
//		Analyzer anal = new IKAnalyzer(true);
		IKSegmenter iks = new IKSegmenter(text, true);
		
		Lexeme term = null;
		while((term = iks.next()) != null){
			System.out.print(term.getLexemeText().toString() + "|");
			
		}
		
//		reader.close();
		System.out.println();
	}

}
